Error Message Customization

Customize the Default Error Message

Code Customization
Customize the Default Error Message
Description:

This customization displays a custom validation error message by setting the ErrorMessage and Text properties of a Validator control. The ErrorMessage property of a Validator control is displayed in a pop-up window while the Text property is displayed at the location of the validator on the web page. This property is set at design time, but can be changed via the Property Sheet. To change it, you simply add or modify the pass-through attributes located in the Custom attributes in the Property Sheet.

You can only set the RequiredFieldValidator for a FieldValue control. Additional validation can be implemented by overriding the Validate() method in the RecordControl class.

Generated Page:

If you try to add a new record without a ProductName, you will see something like this:

Procedure:

Step 1:  Display the Property Sheet for the FieldValue that you wish to modify in a page.

Step 2:  Use the Custom attributes in the Property Sheet to add the attributes.

Attribute

Value

<YourFieldName>RequiredFieldValidator:Enabled

True

<YourFieldName>RequiredFieldValidator:ErrorMessage

Units in stock is required.

Enter a custom error message of your choosing.

<YourFieldName>RequiredFieldValidator:Text

<YourFieldName> is the name of the field.

* (custom);

Step 3:  Build and run the application.

Disclaimer:
Customizations included in this wizard are provided as a sample to demonstrate a feature, and may work only in specific situations. The Iron Speed Designer support team cannot assist in the resolution of problems which may occur as a result of customizing your application or modifying a customization to fit a particular purpose.

Terms of Service Privacy Statement